Getting Started with a Navmesh
This is for all the gamers out there that want to add sp/coop to their BF2 or BF2142 map. Setup: Changing any files in your default Battlefield 2 mod directory will cause 'modified content' errors and you will not be able to join ranked servers. Even if you don't care about multiplayer, still follow these step to keep your original install clean in case of mishaps during your modding: ''' '''Make a complete backup of your BF2 directory. Go to mods/bf2 and copy and paste it. When that's finished you should have 'Copy of bf2' there. This is going to be your untouched multiplayer and backup version if you completely screw up your files playing around in the editor. This is your emergency backup, so you don't have to do a complete re-install when you screw up something and can't figure out why BF2 doesn't work any more. If you do this long enough, eventually it will happen. Set up a work area for adding AI. This is the area that you will use to set up a mod for developing the AI Support. This gives you a sandbox that you can mess around in without screwing up the game. Create a modding folder called mods\edit_bf2 or something similar like mods\navmesh_bf2. It just needs to have a different name from any mods that you actually play. This is where you will set up or use a MOD for testing the AI. Never make any changes directly in the mods\bf2 folder. Always make your changes and do your testing in your own mod. You can use existing mod, such as BF2_all64 as a base for your mod. Just make a copy of it and rename it. Just edit the mod.desc file with notepad or another text editor and change the title to yours. Then copy the map over into your modding area. STEP 1 - Preparing the level folder for the editor The screenshot below shows that Server.zip and Client.zip have been unzipped into the an example level directory. There is a new folder that you create called 'Editor'. This fodler what the editor uses to do most of it's updates. 1.) Unzip 'client.zip' and 'server.zip' into the level's folder. 2.) Make a new folder called 'editor'. Now browse to -> gamemodes\gpm_cq\64\ and copy gameplayobjects.con. Paste it into the editor folder you just created. This is Dice's original 64 sized multiplayer layout and we are going to customize it for Single Player. You can grab the 32 player one if thats your intention. 3.) Open gameplayobjects.con with notepad. The combat area is defined by all the coordinates at the bottom of the gameplayobjects.con file. We are going to delete the original combat area for the purpose of demonstrating how to create your own. Delete all the text below the line 'end if.' Save and close. FYI - The gamemodes for SP are a little diferent to gpm_cq and gpm_coop. This is because Dice originally released BF2 with only coop. SP mode was added in a patch. The 16 size is located in Gamemodes/SP1/16 The 32 size is located in Gamemodes/SP2/32 The 64 size is located in Gamemodes/SP3/64 Dice fixed the SP mode properly in BF2142, so the sp game modes are gpm_sp: 16, 32, 42 and 64. The 16 size is located in Gamemodes/gpm_sp/16 The 32 size is located in Gamemodes/gpm_sp/32 The 48 size is located in Gamemodes/gpm_sp/48 The 64 size is located in Gamemodes/gpm_sp/64 Note: A map can only have one navmesh, so the navmesh has to be made to work with all sp/coop gamemodes. This is why the smaller gamemode combat areas are nested inside the larger game modes. Combat areas at the bottom GamePlayObjects.con. Delete the text that involves the combat area as in the example. Save and close. CombatAreaManager.use 1 CombatAreaManager.timeAllowedOutside 10.000000 CombatArea.create CombatArea_0_Default CombatArea.min 0.000000/0.000000 CombatArea.max 0.000000/0.000000 CombatArea.addAreaPoint -49.508636/309.521057 CombatArea.addAreaPoint -106.653534/302.942810 CombatArea.addAreaPoint -298.430908/215.904358 CombatArea.addAreaPoint -383.601013/252.437683 CombatArea.addAreaPoint -418.348206/229.250977 CombatArea.addAreaPoint -447.901398/-49.729950 CombatArea.addAreaPoint -256.824768/-180.013153 CombatArea.addAreaPoint -134.451721/-145.417114 CombatArea.addAreaPoint -71.780426/-50.112396 CombatArea.addAreaPoint -20.388397/78.607422 CombatArea.addAreaPoint -54.802582/121.588379 CombatArea.addAreaPoint -56.012451/247.228943 CombatArea.addAreaPoint -19.933960/275.608276 CombatArea.team 0 CombatArea.vehicles 4 CombatArea.layer 1 CombatArea.usedByPathFinding 1 STEP 2 - The editor 1.) Start up the bf2 editor. Choose 'BF2'. When that has finished loading, change to the "Level Editor" in the drop down box at the top near the menus. 2) Go to File -> Load and select the map you just prepared (still using Songhua Stalemate as an example) 3) Once that has loaded you will see the map in all its 3d glory. Now for some preliminary steps to make your level editor experience easier on the eye. - Select the 'Render' Menu and uncheck 'Toggle Draw Fog' - If the map already has AI, you can select the 'Render' Menu - 'AI' - and select "Toggle Draw AI" (this will enable you to see the strategic areas and neighboring when you start putting them in later)